{% block sw_promotion_v2_conditions %}
<div class="sw-promotion-v2-conditions">

    {% block sw_promotion_v2_conditions_pre_conditions_card %}
    <mt-card
        :title="$tc('sw-promotion-v2.detail.conditions.preConditions.cardTitlePreConditions')"
        position-identifier="sw-promotion-conditions-pre-conditions"
    >

        {% block sw_promotion_v2_conditions_pre_conditions_sales_channel_selection %}
        <sw-promotion-v2-sales-channel-select
            class="sw-promotion-v2-conditions__sales-channel-selection"
            :promotion="promotion"
            :entity-collection="promotion.salesChannels"
            :disabled="!acl.can('promotion.editor')"
            :label="$tc('sw-promotion-v2.detail.conditions.preConditions.labelPromotionSalesChannel')"
            :placeholder="$tc('sw-promotion-v2.detail.conditions.preConditions.labelPromotionSalesChannel')"
        />
        {% endblock %}

        {% block sw_promotion_v2_conditions_pre_conditions_prevent_combination %}

        <mt-switch
            v-model="promotion.preventCombination"
            class="sw-promotion-v2-conditions__prevent-combination"
            :disabled="!acl.can('promotion.editor')"
            :label="$tc('sw-promotion-v2.detail.conditions.preConditions.labelPreventCombination')"
            :help-text="$tc('sw-promotion-v2.detail.conditions.preConditions.helpTextPreventCombination')"
        />
        {% endblock %}

        {% block sw_promotion_v2_conditions_pre_conditions_exclusions %}
        <sw-entity-multi-select
            class="sw-promotion-v2-conditions__rules-exclusion-selection"
            :label="$tc('sw-promotion-v2.detail.conditions.preConditions.labelPromotionExclusions')"
            :placeholder="$tc('sw-promotion-v2.detail.conditions.preConditions.placeholderPromotionExclusions')"
            :criteria="exclusionCriteria"
            :entity-collection="excludedPromotions"
            :disabled="!acl.can('promotion.editor') || promotion.preventCombination"
            @update:entity-collection="onChangeExclusions"
        />
        {% endblock %}

    </mt-card>
    {% endblock %}

    {% block sw_promotion_v2_rule_conditions_card %}
    <mt-card
        :title="$tc('sw-promotion-v2.detail.conditions.preConditions.cardTitleRuleConditions')"
        position-identifier="sw-promotion-conditions-rules"
    >

        {% block sw_promotion_v2_rule_conditions_rule_select_customer %}
        <sw-promotion-v2-rule-select
            v-if="promotion"
            v-model:collection="promotion.personaRules"
            class="sw-promotion-v2-conditions__rule-select-customer"
            :local-mode="promotion.isNew()"
            :criteria="personaRuleFilter"
            :label="$tc('sw-promotion-v2.detail.conditions.preConditions.labelCustomerSelect')"
            :placeholder="$tc('sw-promotion-v2.detail.conditions.preConditions.placeholderCustomerSelect')"
            :rule-scope="['checkout']"
            :disabled="!acl.can('promotion.editor')"
            rule-aware-group-key="personaPromotions"
        />
        {% endblock %}

        {% block sw_promotion_v2_rule_conditions_rule_select_cart_conditions %}
        <sw-promotion-v2-cart-condition-form
            :promotion="promotion"
            :restricted-rules="cartRestrictedRules"
        />
        {% endblock %}

        {% block sw_promotion_v2_rule_conditions_rule_select_order_conditions %}
        <sw-promotion-v2-rule-select
            v-if="promotion"
            v-model:collection="promotion.orderRules"
            class="sw-promotion-v2-conditions__rule-select-order-conditions"
            :label="$tc('sw-promotion-v2.detail.conditions.preConditions.labelOrderConditionSelect')"
            :placeholder="$tc('sw-promotion-v2.detail.conditions.preConditions.placeholderOrderConditionSelect')"
            :criteria="orderConditionsFilter"
            :rule-scope="['checkout']"
            :disabled="!acl.can('promotion.editor')"
            rule-aware-group-key="orderPromotions"
        />
        {% endblock %}

    </mt-card>
    {% endblock %}

</div>
{% endblock %}
